/**
 * Copyright (c) 2009, 2010  Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.penelope.ui.test.mvp.scope;

import it.uniba.di.cdg.penelope.ui.annotation.View;
import it.uniba.di.cdg.penelope.ui.mvp.IManagedView;
import it.uniba.di.cdg.penelope.ui.mvp.IPresenter;
import it.uniba.di.cdg.penelope.ui.mvp.ViewEvent;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@View( "login" ) 
public class MyView implements IMyView, IManagedView {

	@PostConstruct
	public void show() {
		System.out.println( "MyView.show()" );
		// Crea lo scope!
	}
	
	@PreDestroy
	public void dispose() {
		System.out.println( "MyView.dispose()" );
		// Svuota lo stop
	}
	
	@Override
	public void showMessage(String message) {
		System.out.println( message );
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.penelope.ui.mvp.IManagedView#fire(it.uniba.di.cdg.penelope.ui.mvp.ViewEvent)
	 */
	@Override
	public void fire( ViewEvent event ) {
		// Nothing
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.penelope.ui.mvp.IManagedView#registerPresenter(it.uniba.di.cdg.penelope.ui.mvp.IPresenter)
	 */
	@Override
	public void registerPresenter( IPresenter presenter ) {
		// Nothing
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.penelope.ui.mvp.IManagedView#unregisterPresenter(it.uniba.di.cdg.penelope.ui.mvp.IPresenter)
	 */
	@Override
	public void unregisterPresenter( IPresenter presenter ) {
		// Nothing
	}
}
